﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace YasharEl.Infrastructure.ApplicationModel.Bootstrap.Extensibility
{
    /// <summary>
    /// Extension context implementation which release the IDescribable right after creation.
    /// </summary>
    public class BootstrappingExtensionContext : IBootstrappingExtensionContext
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtensionContext"/> class.
        /// </summary>
        /// <param name="describable">The describable.</param>
        public BootstrappingExtensionContext(IDescribable describable)
        {
            Contract.Requires<ArgumentNullException>(describable != null, "describable could not be null.");

            this.Name = describable.Name;
            this.Description = describable.Describe();
        }

        public string Name { get; private set; }

        public string Description { get; private set; }
    }
}
